package com.wjk.kylin.mall.admin.beanmapper;

import com.wjk.kylin.mall.admin.bo.UserBO;
import com.wjk.kylin.mall.admin.dto.UserInDTO;
import com.wjk.kylin.mall.admin.entity.UserEntity;
import com.wjk.kylin.mall.admin.excel.UserData;
import com.wjk.kylin.mall.common.core.bo.admin.UserNameBO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @Author: wangjinkui
 * @Date: 2021/6/8
 * @Description : 管理员
 */
@Mapper
public interface UserEntityMapper {
    UserEntityMapper INSTANCE = Mappers.getMapper(UserEntityMapper.class);

    /**
     * entity to bo
     * @param entity
     * @return
     */
    UserBO entity2BO(UserEntity entity);

    /**
     * dto to entity
     * @param dto
     * @return
     */
    UserEntity dto2Entity(UserInDTO dto);


    /**
     * entity to bo
     * @param entity
     * @return
     */
    UserNameBO entity2UserNameBO(UserEntity entity);

    /**
     *
     * @param userData
     * @return
     */
    UserEntity userData2UserEntity(UserData userData);
    List<UserEntity> userData2UserEntityList(List<UserData> userDataList);
    /**
     *
     * @param userEntity
     * @return
     */
    UserData userEntity2UserData(UserEntity userEntity);
    List<UserData> userEntity2UserDataList(List<UserEntity> userEntityList);
}
